﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Test_Drag_N_drop
{
    class LaunchButton : Button
    {
        private Game1 myGame;

        public LaunchButton (Game1 game) : base()
        {
            myGame = game;
        }

        public override void LoadContent(ContentManager content)
        {
            textureIdle = content.Load<Texture2D>("LaunchButtonIdle");
            textureOver = content.Load<Texture2D>("LaunchButtonOver");
            _texture = textureIdle;
            rectangle.X = rectangle.X - _texture.Width / 2;
            rectangle.Y = rectangle.Y - _texture.Height / 2;
            rectangle.Width = _texture.Width;
            rectangle.Height = _texture.Height;
        }

        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(_texture, rectangle, Color.White);
        }

        protected override void doAction(int mX, int mY)
        {
            myGame.launchL2C();
        }
    }
}
